﻿using PMS.Data.DbUtils;
using PMS.Data.Entities.Messages;
using PMS.Services.Caching.Extensions;

namespace PMS.Services.EntityServices.Messages
{
    public class SMSAccountService : ISMSAccountService
    {
        #region Fields

        private readonly IRepository<SMSAccount> _smsAccountRepository;

        #endregion

        #region Ctor

        public SMSAccountService(IRepository<SMSAccount> smsAccountRepository)
        {
            _smsAccountRepository = smsAccountRepository;
        }

        #endregion


        #region Methods
        public SMSAccount GetSMSAccountById(int smsAccountId)
        {
            if (smsAccountId == 0)
                return null;

            return _smsAccountRepository.ToCachedGetById(smsAccountId);
        }
        #endregion
    }
}
